cmake_minimum_required (VERSION 2.6)

project(example)
SET(CMAKE_BUILD_TYPE "Release")

#
# Protobuf
#
find_package(Protobuf REQUIRED)
PROTOBUF_GENERATE_CPP(PROTO_SRCS PROTO_HDRS sample.proto)
include_directories(${PROTOBUF_INCLUDE_DIR})

#
# Boost library.
#
set(Boost_USE_STATIC_LIBS ON)
FIND_PACKAGE(Boost COMPONENTS regex)
INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIR})
ADD_DEFINITIONS( "-DHAS_BOOST" )

#
# Example program.
#
add_executable(example example.cc ${PROTO_SRCS} ${PROTO_HDRS})
target_link_libraries(example
  libgflags.a
  libglog.a
  pthread
  ${PROTOBUF_LIBRARY}
  ${Boost_LIBRARIES}
  )

